﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
	</head>
	<body>
		<div id="app" v-demo:foo.a.b="message"></div>
	
		<script src="vue.js"></script>
		<script>
			Vue.directive('demo', {
			  bind: function (el, binding, vnode) {
			    var s = JSON.stringify
			    el.innerHTML =
			      'name: '       + s(binding.name) + '<br>' +
			      'value: '      + s(binding.value) + '<br>' +
			      'expression: ' + s(binding.expression) + '<br>' +
			      'argument: '   + s(binding.arg) + '<br>' +
			      'modifiers: '  + s(binding.modifiers) + '<br>' +
			      'vnode keys: ' + Object.keys(vnode).join(', ')
			  }
			})
			new Vue({
			  el: '#app',
			  data: {
			    message: 'Vue.js无难事'
			  }
			})
		</script>
	</body>
</html>